import request from '@/utils/request';
// mock
// 列表
export const getMarketingAppletList = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/list',
        method: 'GET',
        params: data,
        timeout: 1000 * 60 * 5
    });
};

// 列表
export const getMiniAppList = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/list',
        method: 'GET',
        params: data
    });
};

// 已有小程序获取授权页面url
export const getInstallLink = (data: any) => {
    return request({
        url: '/scrm-api/console/component/install/link',
        method: 'GET',
        params: data
    });
};

// 已有小程序授权
export const setMiniAppAuth = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/auth',
        method: 'POST',
        data
    });
};

// 获取复用公众号快速注册小程序授权url
export const getFastRegUrl = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/fast_reg_url',
        method: 'POST',
        data
    });
};

// 复用公众号快速注册小程序
export const setFastReg = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/fast_reg',
        method: 'POST',
        data,
        timeout: 1000 * 30
    });
};

// 快速注册小程序-填写法人信息
export const setApplyReg = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/apply/reg',
        method: 'POST',
        data
    });
};

// 小程序基本信息
export const getMiniAppInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/info',
        method: 'POST',
        data
    });
};

// 提交审核
export const miniAppRecommit = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/recommit',
        method: 'POST',
        data
    });
};

// 生成体验二维码
export const miniAppExperienceUrl = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/experience_url',
        method: 'POST',
        data
    });
};

// 取消审核
export const miniAppApplyCancel = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/apply/cancel',
        method: 'POST',
        data
    });
};

// 制作小程序自定义页
export const miniAppCustomSet = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/custom/set',
        method: 'POST',
        data
    });
};

// 注册页面信息
export const miniAppApplyRegInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/apply/reg-info',
        method: 'GET',
        params: data
    });
};

// 小程序介绍页面详情
export const miniAppCustomInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/custom/info',
        method: 'POST',
        data
    });
};

// 小程序介绍页面图片删除
export const miniAppCustomDel = (data: any) => {
    return request({
        url: '/scrm-api/console/miniapp/custom/del',
        method: 'POST',
        data
    });
};

//查看小程序
export const simpleView = (data: any) => {
    return request({
        url: '/scrm-api/console/component/mini/simple-view',
        method: 'GET',
        params: data
    });
};

//判断会员小程序是否存在以及状态
export const getMemberStatus = (data?: any) => {
    return request({
        url: '/scrm-api/console/miniapp/member-status',
        method: 'GET',
        params: data
    });
};
